﻿using System.Collections.Generic;

namespace SharePointUtilitiesForDevelopers.Mapper
{
    /// <summary>
    /// Defines the interface for a mapper.
    /// </summary>
    /// <typeparam name="TFrom">The type to map from.</typeparam>
    /// <typeparam name="TTo">The type to map to.</typeparam>
    public interface IMapper<TFrom, TTo>
    {
        /// <summary>
        /// Maps the source type to the target type.
        /// </summary>
        /// <param name="from">The object to map from.</param>
        /// <returns>The mapped object.</returns>
        TTo Map(TFrom from);

        /// <summary>
        /// Maps the source type to a list of the target type.
        /// </summary>
        /// <param name="from">From.</param>
        /// <returns></returns>
        IEnumerable<TTo> MapList(TFrom from);
    }
}